package com.cgbl.cg.adapter

import android.graphics.Bitmap
import android.util.Log
import android.widget.ImageView
import com.bumptech.glide.Glide
import com.bumptech.glide.load.DataSource
import com.bumptech.glide.load.engine.GlideException
import com.bumptech.glide.request.RequestListener
import com.bumptech.glide.request.target.Target
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.cgbl.cg.R
import com.robot.base.model.WorksBean
import com.robot.base.utils.pic.ImageLoaderUtils

class WorksAdapter : BaseQuickAdapter<WorksBean, BaseViewHolder>(R.layout.app_item_works) {

    private var isEditModel = hashMapOf<Int, Boolean>()

    override fun convert(holder: BaseViewHolder, item: WorksBean) {
        holder.getView<ImageView>(R.id.iv_more).setOnClickListener {
            val thisIsEditModel = isEditModel[holder.adapterPosition] ?: false
            val tempIsEditModel = !thisIsEditModel
            isEditModel[holder.adapterPosition] = tempIsEditModel
            holder.setGone(R.id.item_iv_bg, tempIsEditModel)
            holder.setGone(R.id.ll_more_layout, tempIsEditModel)
        }
    }
}